﻿@using DirectSell.Model.User
@using Webdiyer.WebControls.Mvc;
@model  PagedList<UserInforMationDetails>

<div class="table-responsive">
    <label style="float:left" class="active alert-info">电子币余额: @ViewBag.Balance</label>
    @if (Model.Count > 0)
    {
        <table class="table table-bordered table-striped">
            <tr>
                <th>序号</th>
                <th>日期</th>
                <th>会员编号</th>
                <th>会员级别</th>
                <th>会员姓名</th>
                <th>手机号</th>
                <th>投资额</th>
                <th>状态</th>
                <th>操作</th>
            </tr>
            @{ int i = 0;}
            @foreach (var item in Model)
            {

                <tr>
                    <td>@(Model.StartItemIndex + i++)</td>
                    <td>@item.RegistionTime</td>
                    <td>@item.UserCode</td>
                    <td>@item.LevelName</td>
                    <td>@item.UserName</td>
                    <th>@item.Phone</th>
                    <th>@string.Format("{00:f2}", item.Investment)</th>
                    @switch (item.UserStatus)
                    {
                        case 0:
                            <td><p style="color:palevioletred">未激活</p></td>; break;
                        case 1:
                            <td><p style="color:blue">已激活</p></td>; break;
                    }
                    @if (item.UserStatus == 0)
                    {
                        <td>
                            <button class="btn btn-purple" type="button" onclick="Activation(@item.UserId)">激活</button>
                            <button class="btn btn-danger" type="button" onclick="Delete(@item.UserId)">删除</button>
                        </td>
                    }
                    else
                    {
                        <td>
                            <a>|</a>
                        </td>
                    }
                </tr>
            }
        </table>
                }

                else
                {
                    <table class="table table-bordered table-striped">
                        <tr>

                            <th>信息</th>
                        </tr>
                        <tr><td>暂无相关数据</td></tr>
                    </table>
                }
</div>